<?php
declare(strict_types=1);

use Zms\Validate\{
    Type
};
use function Zms\Validate\validate;

include "../vendor/autoload.php";

$data = [
    'user' => [
        'name' => '张三',//用户名
        'mobile' => '18676405902',
    ],
    'bankcard' => '5162-2848-7889-7794'
];

$result = validate([
    [['user.mobile'], Type::MOBILE],
    [['user.name'], Type::STRING],
    [['bankcard'], Type::BANKCARD,'luhn'=>false,'convert'=>true],
], $data, [
    'user.mobile' => '用户手机',
    'bankcard' => '银行卡号'
]);
print_r($result);
